package cn.com.cym.gamezao.entity.single;

import cn.com.cym.gamezao.base.BaseEntity;
import cn.com.cym.gamezao.enums.StatusDesc;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.lang.NonNull;
import org.springframework.web.multipart.MultipartFile;

import javax.persistence.*;
import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;


@Setter
@Getter
@NoArgsConstructor
@Table(name = "s_lost_found")
@Entity
@ApiModel(description = "失物招领")
public class LostFound extends BaseEntity implements Serializable {


    private static final long serialVersionUID = -8824857855000090526L;


    /**
     * 拾荒人 捡到人员
     */
    @Column(length = 36)
    @ApiModelProperty(value = "拾到人员",dataType = "String",required = true)
    @NonNull
    private String gleanMan;


    /**
     * 录入人员
     */
    @Column(length = 36)
    @ApiModelProperty(value = "记录人",dataType = "String",required = true)
    @NonNull
    private String enterMan;

    /**
     * UUid
     */
    @Column(length = 64)
    @NonNull
    @ApiModelProperty(value = "文件uuid",dataType = "String",required = true)
    private String fileRandomId;

    /**
     * 失物名称
     */
    @Column(length = 36)
    @ApiModelProperty(value = "失物名称",dataType = "String",required = true)
    @NonNull
    private String lostName;


    /**
     * 失物等级 （后续查看是否需要判断为本人领取还是可以代领）
     */
    @ApiModelProperty(value = "失物等级",dataType = "Integer")
    private Integer lostLevel=1;


    /**
     * 丢失时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "丢失时间",dataType = "LocalDateTime",required = true)
    private LocalDateTime lostDateTime = LocalDateTime.now();


    /**
     * 来源科室，地址
     */
    @Column(length = 200)
    @ApiModelProperty(value = "丢失地点",dataType = "String",required = true)
    private String originDepart;

    /**
     * 丢失人员
     */
    @Column(length = 36)
    @ApiModelProperty(value = "失主名字",dataType = "String")
    private String lostOwnerName;


    /**
     * 丢失人员联系方式
     */
    @ApiModelProperty(value = "失主电话",dataType = "String")
    private Long tel;


    /**
     * 领取人员
     */
    @Column(length = 36)
    @ApiModelProperty(value = "领取人员",dataType = "String")
    private String drawer;


    /**
     * 领取人证件号
     */
    @Column(length = 20)
    @ApiModelProperty(value = "领取人证件号",dataType = "String")
    private String drawCard;


    /**
     * 领取人电话
     */
    @Column(length = 16)
    @ApiModelProperty(value = "领取人电话",dataType = "String")
    private String drawTel;


    /**
     * 失物发放人员
     */
    @Column(length = 36)
    @ApiModelProperty(value = "发放人员",dataType = "String")
    private String provider;


    /**
     * 发放时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "领取时间",dataType = "LocalDateTime")
    private LocalDateTime provideDateTime;

    /**
     * 文件描述
     */
    @Column(length = 200)
    @ApiModelProperty(value = "失物描述",dataType = "String",required = true)
    private String fileDesc;


    /**
     * 是否完成认领
     */
    @ApiModelProperty(value = "是否完成认领",dataType = "Boolean")
    private Boolean claim=false;

    /**
     * 当前状态
     */
    @ApiModelProperty(value = "当前状态",dataType = "StatusDesc")
    @Column(length = 20)
    private String statusDesc = StatusDesc.CREATE.name();
}
